package com.hourses.controller;

import com.hourses.pojo.Auth;
import com.hourses.pojo.Result;
import com.hourses.service.impl.AuthServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description:
 * @Author:LiTao
 * @Date:2025/4/30 17:24
 */
@RestController
@RequestMapping("/auth")
public class AuthController {

    //获取角色权限树   http://localhost:3000/api/auth/auth-tree
    @Autowired
    private AuthServiceImpl authService;
    @GetMapping("/auth-tree")
    public Result getAllAuths(){
        List<Auth> allAuthTree = authService.getAllAuthTree();
        return Result.ok(allAuthTree);
    }
}
